package thread;

/**
 * @author DBX
 * @effect 第三种匿名内部类完成线程的两种创建
 * @date 2021/8/31 0031 - 14:02
 */
public class ThreadDemo2 {
    public static void main(String[] args) {
        Thread t1 = new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 1000; i++) {
                    System.out.println("嘿");
                }
            }
        });
        Thread t2 = new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 1000; i++) {
                    System.out.println("哈");
                }
            }
        });

        Thread t3 = new Thread(()->{
            for (int i = 0; i < 1000; i++) {
                System.out.println("哼");
            }
        });
        t1.start();
        t2.start();
        t3.start();
    }
}
